﻿<util:BaseUserControl x:Class="CheckerWPF.UserControls.RadioButtonAligned"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:conv="clr-namespace:CheckerWPF.Converters"
             xmlns:uctl="clr-namespace:CheckerWPF.UserControls"
             xmlns:util="clr-namespace:CheckerWPF.Utils"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid Name="LayoutRoot">
        <Grid.Resources>
            <conv:CheckAlignmentConverter x:Key="CheckAlignmentConverter" />
            <conv:HorizontalAlignmentConverter x:Key="HorizontalAlignmentConverter" />
        </Grid.Resources>

        <StackPanel Name="stkAlignment" Orientation="Horizontal" HorizontalAlignment="{Binding CheckAlign, Converter={StaticResource HorizontalAlignmentConverter}}" VerticalAlignment="Center" >
            <TextBlock Name="txtLeftContent" Margin="0,0,3,0" Text="{Binding OptionText}" 
                       Visibility="{Binding CheckAlign, Converter={StaticResource CheckAlignmentConverter}, ConverterParameter=L}" />
            <uctl:MyRadioButton x:Name="radOption" Content="" IsChecked="{Binding OptionChecked, Mode=TwoWay}" />
            <TextBlock Name="txtRightContent" Margin="3,0,0,0" Text="{Binding OptionText}" 
                       Visibility="{Binding CheckAlign, Converter={StaticResource CheckAlignmentConverter}, ConverterParameter=R}" />
        </StackPanel>
    </Grid>
</util:BaseUserControl>
